﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace Nexxt.Framework.TypeReaders
{
    public class GameObjectTypeReader :  ContentTypeReader<GameObject>
    {
        protected override GameObject Read(ContentReader input, GameObject existingInstance)
        {
            GameObject gameObject = new GameObject();
            gameObject.Name = input.ReadString();
            gameObject.IsActive = input.ReadBoolean();
            gameObject.IsCollectable = input.ReadBoolean();
            gameObject.IsMovable = input.ReadBoolean();
            gameObject.Texture = input.ReadExternalReference<Texture2D>();
            gameObject.Position = input.ReadVector2();
            return gameObject;
        }
    }
}
